%tr.highlight{:id => user.html_id}
  %td{:align => :right}= user.id
  %td.auto{:align => :left}
    - if user.blocked?
      %del= user.nickname
      .label.label-warning 已屏蔽
    - else
      %strong
        = user_profile_link(user, :class => :black)
  %td.w50{:align => :left}
    - if user.root?
      %strong.green ROOT
    - elsif user.admin?
      = image_tag 'star.png'
    - else
      %span.gray 普通

  %td.auto{:align => :left}= user.email
  %td.auto{:align => :right}
    = user.reward
  %td.center
    - if can? :edit_info, user
      = link_to '修改用户信息', edit_admin_user_path(user), :class => 'btn btn-sm'

    - if current_user.can_manage_site? and user != current_user and (not user.root?)
      - if user.admin?
        = link_to '取消管理权限', toggle_admin_admin_user_path(user), :method => :patch, :remote => true, :class => 'btn btn-sm'
      - else
        = link_to '提升为管理员', toggle_admin_admin_user_path(user), :method => :patch, :remote => true, :class => 'btn btn-sm'

      - if user.blocked?
        = link_to '取消屏蔽', toggle_blocked_admin_user_path(user), :method => :patch, :remote => true, :class => 'btn btn-sm'
      - else
        = link_to '屏蔽', toggle_blocked_admin_user_path(user), :method => :patch, :remote => true, :class => 'btn btn-sm btn-danger'

